Added support for setting boothowto from boot loader flags.

print out string of `.' when powering down to work around ununderstood
behavior of rtc chip.
This commit is contained in:
dbj 1999-01-31 07:02:33 +00:00
parent f0b3caaceb
commit 21ab415ee6
4 changed files with 85 additions and 53 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.11 1999/01/09 22:10:19 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.12 1999/01/31 07:02:33 dbj Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -102,6 +102,7 @@
#include <machine/kcore.h> /* XXX should be pulled in by sys/kcore.h */
#include <next68k/next68k/seglist.h>
#include <next68k/next68k/nextrom.h>
#define MAXMEM 64*1024*CLSIZE /* XXX - from cmap.h */
@ -220,14 +221,27 @@ next68k_init()
#endif
}
#if 1
/* @@@ Since the boot rom doesn't know how to pass in
* these parameters yet, I manually set them here while debugging
* the scsi driver.
* Darrin B. Jewell <dbj@netbsd.org> Sun Jul 19 06:14:52 1998
*/
boothowto = RB_KDB | RB_ASKNAME;
#endif
{
char *p = rom_boot_arg;
boothowto = 0;
if (*p++ == '-') {
for (;*p;p++) {
switch(*p) {
case 'a':
boothowto |= RB_ASKNAME;
break;
case 's':
boothowto |= RB_SINGLE;
break;
case 'd':
boothowto |= RB_KDB;
break;
default:
break;
}
}
}
}
/* Initialize the interrupt handlers. */
isrinit();
@ -261,11 +275,7 @@ consinit()
if (!init) {
/* @@@ I used to call cninit() before ddb_init(),
* but then I had to debug something in the console
* initiailization. I still don't know if this is
* okay, but it looks like it will work.
*/
cninit();
#ifdef DDB
/*
@ -279,8 +289,6 @@ consinit()
}
#endif
cninit();
#ifdef DDB
if (boothowto & RB_KDB) {
Debugger();
@ -800,11 +808,16 @@ cpu_reboot(howto, bootstr)
}
#endif
if (howto & RB_POWERDOWN) {
poweroff();
}
/* Finally, halt/reboot the system. */
if (howto & RB_HALT) {
printf("System halted. Hit any key to reboot.\n\n");
(void)cngetc();
}
#if 0
printf("rebooting...\n");
DELAY(1000000);

View File

@ -1,4 +1,4 @@
/* $NetBSD: nextrom.c,v 1.7 1998/08/28 22:56:08 dbj Exp $ */
/* $NetBSD: nextrom.c,v 1.8 1999/01/31 07:02:34 dbj Exp $ */
/*
* Copyright (c) 1998 Darrin B. Jewell
* All rights reserved.
@ -96,6 +96,11 @@ static char romprint_hextable[] = "0123456789abcdef@";
#endif
u_char rom_enetaddr[6];
u_char rom_boot_dev[20];
u_char rom_boot_arg[20];
u_char rom_boot_info[20];
u_char rom_boot_file[20];
u_char rom_bootfile[MG_boot_how-MG_bootfile];
void
next68k_bootargs(args)
@ -203,7 +208,6 @@ next68k_bootargs(args)
}
}
#if 1
{
int i;
ROM_PUTS("Memory segments found:\r\n");
@ -221,12 +225,10 @@ next68k_bootargs(args)
ROM_PUTS("\r\n");
}
}
#endif
/* Read the ethernet address from rom, this should be done later
* in device driver somehow.
*/
#if 1
{
int i;
ROM_PUTS("Ethernet address: ");
@ -237,30 +239,39 @@ next68k_bootargs(args)
}
ROM_PUTS("\r\n");
}
#else
/* Read the boot args
*/
{
ROM_PUTS("Ethernet address: ");
RELOC(rom_enetaddr[0], u_char) = MONRELOC(u_char *, MG_clientetheraddr)[0];
ROM_PUTX(RELOC(rom_enetaddr[0],u_char));
ROM_PUTS(":");
RELOC(rom_enetaddr[1], u_char) = MONRELOC(u_char *, MG_clientetheraddr)[1];
ROM_PUTX(RELOC(rom_enetaddr[1],u_char));
ROM_PUTS(":");
RELOC(rom_enetaddr[2], u_char) = MONRELOC(u_char *, MG_clientetheraddr)[2];
ROM_PUTX(RELOC(rom_enetaddr[2],u_char));
ROM_PUTS(":");
RELOC(rom_enetaddr[3], u_char) = MONRELOC(u_char *, MG_clientetheraddr)[3];
ROM_PUTX(RELOC(rom_enetaddr[3],u_char));
ROM_PUTS(":");
RELOC(rom_enetaddr[4], u_char) = MONRELOC(u_char *, MG_clientetheraddr)[4];
ROM_PUTX(RELOC(rom_enetaddr[4],u_char));
ROM_PUTS(":");
RELOC(rom_enetaddr[5], u_char) = MONRELOC(u_char *, MG_clientetheraddr)[5];
ROM_PUTX(RELOC(rom_enetaddr[5],u_char));
ROM_PUTS("\r\n");
int i;
for(i=0;i<sizeof(rom_bootfile);i++) {
RELOC(rom_bootfile[i], u_char) = MONRELOC(u_char, MG_bootfile+i);
}
for(i=0;i<sizeof(rom_boot_dev);i++) {
RELOC(rom_boot_dev[i], u_char) = MONRELOC(u_char *, MG_boot_dev)[i];
if (MONRELOC(u_char *, MG_boot_dev)[i] == '\0') break;
}
RELOC(rom_boot_dev[sizeof(rom_boot_dev)-1], u_char) = 0;
for(i=0;i<sizeof(rom_boot_arg);i++) {
RELOC(rom_boot_arg[i], u_char) = MONRELOC(u_char *, MG_boot_arg)[i];
if (MONRELOC(u_char *, MG_boot_arg)[i] == '\0') break;
}
RELOC(rom_boot_arg[sizeof(rom_boot_arg)-1], u_char) = 0;
for(i=0;i<sizeof(rom_boot_info);i++) {
RELOC(rom_boot_info[i], u_char) = MONRELOC(u_char *, MG_boot_info)[i];
if (MONRELOC(u_char *, MG_boot_info)[i] == '\0') break;
}
RELOC(rom_boot_info[sizeof(rom_boot_info)-1], u_char) = 0;
for(i=0;i<sizeof(rom_boot_file);i++) {
RELOC(rom_boot_file[i], u_char) = MONRELOC(u_char *, MG_boot_file)[i];
if (MONRELOC(u_char *, MG_boot_file)[i] == '\0') break;
}
RELOC(rom_boot_file[sizeof(rom_boot_file)-1], u_char) = 0;
}
#endif
ROM_PUTS("Check serial port A for console.\r\n");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: nextrom.h,v 1.3 1998/11/10 22:45:45 dbj Exp $ */
/* $NetBSD: nextrom.h,v 1.4 1999/01/31 07:02:34 dbj Exp $ */
/*
* Copyright (c) 1998 Darrin B. Jewell
* All rights reserved.
@ -239,5 +239,11 @@ caddr_t mon_alloc();
#define NeXT_TURBO_COLOR 5 /* probed witnessed */
extern u_char rom_enetaddr[];
extern u_char rom_boot_dev[];
extern u_char rom_boot_arg[];
extern u_char rom_boot_info[];
extern u_char rom_boot_file[];
extern u_char rom_bootfile[];
#endif /* NEXTROM_H_INCLUDED */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtc.c,v 1.2 1999/01/27 11:27:17 dbj Exp $ */
/* $NetBSD: rtc.c,v 1.3 1999/01/31 07:02:34 dbj Exp $ */
/*
* Copyright (c) 1998 Darrin Jewell
* Copyright (c) 1997 Rolf Grossmann
@ -237,6 +237,8 @@ poweroff(void)
rtc_write(reg, rtc_read(reg)|(RTC_PDOWN));
printf("....................."); /* @@@ work around some sort of bug. */
panic("Failed to poweroff!\n");
}