void kgdb_port_init() { # if (NCOM > 0) # define KGDB_DEVMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) if (mach_type == MACH_SGI_IP32) com_kgdb_attach(3, 0xbf398000, 9600, COM_FREQ, COM_TYPE_NORMAL, KGDB_DEVMODE); # endif /* (NCOM > 0) */ # if (NZSC > 0) switch(mach_type) { case MACH_SGI_IP12: case MACH_SGI_IP20: case MACH_SGI_IP22: zs_kgdb_init(); /* XXX */ } # endif }
void consinit(void) { #if 0 int inSource, outSink; #endif switch (prom_version()) { #if 0 case PROM_OLDMON: case PROM_OBP_V0: /* The stdio handles identify the device type */ inSource = prom_stdin(); outSink = prom_stdout(); break; // XXXMRG should these just set prom_stdin_node / prom_stdout_node? #endif case PROM_OBP_V2: case PROM_OBP_V3: case PROM_OPENFIRM: /* Save PROM arguments for device matching */ prom_get_device_args("stdin-path", prom_stdin_args, sizeof(prom_stdin_args)); prom_get_device_args("stdout-path", prom_stdout_args, sizeof(prom_stdout_args)); /* * Translate the STDIO package instance (`ihandle') -- that * the PROM has already opened for us -- to a device tree * node (i.e. a `phandle'). */ prom_stdin_node = prom_instance_to_package(prom_stdin()); if (prom_stdin_node == 0) printf("consinit: cannot convert stdin ihandle\n"); prom_stdout_node = prom_instance_to_package(prom_stdout()); if (prom_stdout_node == 0) { printf("consinit: cannot convert stdout ihandle\n"); break; } break; default: break; } /* Wire up /dev/console */ cn_tab->cn_dev = makedev(cdevsw_lookup_major(&kd_cdevsw), 0); cn_tab->cn_pri = CN_INTERNAL; /* Set up initial PROM input channel for /dev/console */ cons_attach_input(&prom_cons_channel, cn_tab); #ifdef KGDB zs_kgdb_init(); /* XXX */ #endif }
/* * This function replaces sys/dev/cninit.c * Determine which device is the console using * the PROM "input source" and "output sink". */ void cninit(void) { struct sunromvec *v; struct zschan *zc; struct consdev *cn; int channel, zs_unit, zstty_unit; uint8_t inSource, outSink; extern const struct cdevsw zstty_cdevsw; /* Get the zs driver ready for console duty. */ zs_init(); v = romVectorPtr; inSource = *v->inSource; outSink = *v->outSink; if (inSource != outSink) { mon_printf("cninit: mismatched PROM output selector\n"); } switch (inSource) { default: mon_printf("cninit: invalid inSource=%d\n", inSource); sunmon_abort(); inSource = 0; /* fall through */ case 0: /* keyboard/display */ #if NKBD > 0 zs_unit = 0; channel = 0; cn = &consdev_kd; /* Set cn_dev, cn_pri in kd.c */ break; #else /* NKBD */ mon_printf("cninit: kdb/display not configured\n"); sunmon_abort(); inSource = 1; /* fall through */ #endif /* NKBD */ case 1: /* ttya */ case 2: /* ttyb */ case 3: /* ttyc (rewired keyboard connector) */ case 4: /* ttyd (rewired mouse connector) */ zstty_unit = inSource - 1; zs_unit = zstty_conf[zstty_unit].zs_unit; channel = zstty_conf[zstty_unit].channel; cn = &consdev_tty; cn->cn_dev = makedev(cdevsw_lookup_major(&zstty_cdevsw), zstty_unit); cn->cn_pri = CN_REMOTE; break; } /* Now that inSource has been validated, print it. */ mon_printf("console is %s\n", prom_inSrc_name[inSource]); zc = zs_get_chan_addr(zs_unit, channel); if (zc == NULL) { mon_printf("cninit: zs not mapped.\n"); return; } zs_conschan = zc; zs_hwflags[zs_unit][channel] = ZS_HWFLAG_CONSOLE; cn_tab = cn; (*cn->cn_init)(cn); #ifdef KGDB zs_kgdb_init(); #endif }