Clean up console device selection logic.
This commit is contained in:
parent
937db2de33
commit
60573f92d1
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: console.c,v 1.17 2004/01/01 13:29:08 sekiya Exp $ */
|
||||
/* $NetBSD: console.c,v 1.18 2004/01/10 03:18:23 sekiya Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
|
||||
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: console.c,v 1.17 2004/01/01 13:29:08 sekiya Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: console.c,v 1.18 2004/01/10 03:18:23 sekiya Exp $");
|
||||
|
||||
#include "opt_kgdb.h"
|
||||
#include "opt_machtypes.h"
|
||||
|
@ -79,67 +79,64 @@ consinit()
|
|||
consdev = ARCBIOS->GetEnvironmentVariable("ConsoleOut");
|
||||
if (consdev == NULL) {
|
||||
printf("WARNING: ConsoleOut environment variable not set\n");
|
||||
goto force_arcs;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get comm speed from ARCS */
|
||||
dbaud = ARCBIOS->GetEnvironmentVariable("dbaud");
|
||||
speed = strtoul(dbaud, NULL, 10);
|
||||
|
||||
switch (mach_type) {
|
||||
#if defined(IP2X)
|
||||
if (mach_type == MACH_SGI_IP22) {
|
||||
if (strcmp(consdev, "video()") == 0) {
|
||||
/* XXX Assumes that if output is video() input must be
|
||||
* keyboard(). */
|
||||
case MACH_SGI_IP20:
|
||||
case MACH_SGI_IP22:
|
||||
#if (NGIO > 0) && (NPCKBC > 0)
|
||||
if (strcmp(consdev, "video()") == 0) {
|
||||
/* XXX Assumes that if output is video()
|
||||
input must be keyboard(). */
|
||||
gio_cnattach();
|
||||
|
||||
#if (NGIO > 0)
|
||||
gio_cnattach();
|
||||
/* XXX Hardcoded iotag, HPC address XXX */
|
||||
pckbc_cnattach(1,
|
||||
0x1fb80000+HPC_PBUS_CH6_DEVREGS+IOC_KB_REGS,
|
||||
KBCMDP, PCKBC_KBD_SLOT);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (NPCKBC > 0)
|
||||
/* XXX Hardcoded iotag, HPC address XXX */
|
||||
pckbc_cnattach(1,
|
||||
0x1fb80000 + HPC_PBUS_CH6_DEVREGS + IOC_KB_REGS,
|
||||
KBCMDP, PCKBC_KBD_SLOT);
|
||||
#if (NZSC > 0)
|
||||
if ( (strlen(consdev) == 9) &&
|
||||
(!strncmp(consdev, "serial", 6)) &&
|
||||
(consdev[7] == '0' || consdev[7] == '1')) {
|
||||
cn_tab = &zs_cn;
|
||||
(*cn_tab->cn_init)(cn_tab);
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif /* IP2X */
|
||||
|
||||
#if defined(IP32)
|
||||
case MACH_SGI_IP32:
|
||||
#if (NCOM > 0)
|
||||
if ( (strlen(consdev) == 9) &&
|
||||
(!strncmp(consdev, "serial", 6)) &&
|
||||
(consdev[7] == '0' || consdev[7] == '1')) {
|
||||
delay(10000);
|
||||
/* XXX: hardcoded MACE iotag */
|
||||
if (comcnattach(3,
|
||||
MIPS_PHYS_TO_KSEG1(MACE_BASE +
|
||||
((consdev[7] == '0') ?
|
||||
MACE_ISA_SER1_BASE:MACE_ISA_SER2_BASE)),
|
||||
speed, COM_FREQ, COM_TYPE_NORMAL,
|
||||
comcnmode) == 0)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(IP2X)) && (NZSC > 0)
|
||||
if ( (mach_type == MACH_SGI_IP20) || (mach_type == MACH_SGI_IP22) ) {
|
||||
if (strlen(consdev) == 9 &&
|
||||
strncmp(consdev, "serial", 6) == 0 &&
|
||||
(consdev[7] == '0' || consdev[7] == '1')) {
|
||||
cn_tab = &zs_cn;
|
||||
(*cn_tab->cn_init)(cn_tab);
|
||||
return;
|
||||
}
|
||||
panic("ip32 supports serial console only. sorry.");
|
||||
break;
|
||||
#endif /* IP32 */
|
||||
default:
|
||||
printf("Using ARCS for console I/O.\n");
|
||||
break;
|
||||
}
|
||||
#endif /* (IP2X) && (NZSC > 0) */
|
||||
|
||||
#if defined(IP32) && (NCOM > 0)
|
||||
if (mach_type == MACH_SGI_IP32) {
|
||||
if (strlen(consdev) == 9 &&
|
||||
strncmp(consdev, "serial", 6) == 0 &&
|
||||
(consdev[7] == '0' || consdev[7] == '1')) {
|
||||
delay(10000);
|
||||
/* XXX: hardcoded MACE iotag */
|
||||
if (comcnattach(3, MIPS_PHYS_TO_KSEG1(MACE_BASE +
|
||||
((consdev[7] == '0') ?
|
||||
MACE_ISA_SER1_BASE : MACE_ISA_SER2_BASE)),
|
||||
speed, COM_FREQ, COM_TYPE_NORMAL, comcnmode) == 0)
|
||||
return;
|
||||
|
||||
panic("can't init serial hardware console!");
|
||||
}
|
||||
panic("ip32 supports serial console only. sorry.");
|
||||
}
|
||||
#endif /* IP32 && (NCOM > 0) */
|
||||
|
||||
force_arcs:
|
||||
printf("Using ARCS for console I/O.\n");
|
||||
}
|
||||
|
||||
#if defined(KGDB)
|
||||
|
|
Loading…
Reference in New Issue