#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dec_3000_300.c,v 1.50 2025/03/09 01:06:41 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/termios.h>
#include <sys/conf.h>
#include <machine/rpb.h>
#include <machine/autoconf.h>
#include <machine/cpuconf.h>
#include <dev/tc/tcvar.h>
#include <dev/tc/tcdsvar.h>
#include <alpha/tc/tc_3000_300.h>
#include <machine/z8530var.h>
#include <dev/tc/zs_ioasicvar.h>
#include "wsdisplay.h"
void dec_3000_300_init(void);
static void dec_3000_300_cons_init(void);
static void dec_3000_300_device_register(device_t, void *);
const struct alpha_variation_table dec_3000_300_variations[] = {
{ SV_ST_PELICAN, "DEC 3000/300 (\"Pelican\")" },
{ SV_ST_PELICA, "DEC 3000/300L (\"Pelica\")" },
{ SV_ST_PELICANPLUS, "DEC 3000/300X (\"Pelican+\")" },
{ SV_ST_PELICAPLUS, "DEC 3000/300LX (\"Pelica+\")" },
{ 0, NULL },
};
void
dec_3000_300_init(void)
{
uint64_t variation;
platform.family = "DEC 3000/300 (\"Pelican\")";
if ((platform.model = alpha_dsr_sysname()) == NULL) {
variation = hwrpb->rpb_variation & SV_ST_MASK;
if ((platform.model = alpha_variation_name(variation,
dec_3000_300_variations)) == NULL)
platform.model = alpha_unknown_sysname();
}
platform.iobus = "tcasic";
platform.cons_init = dec_3000_300_cons_init;
platform.device_register = dec_3000_300_device_register;
}
static void
dec_3000_300_cons_init(void)
{
struct ctb *ctb;
ctb = (struct ctb *)(((char *)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case CTB_GRAPHICS:
#if NWSDISPLAY > 0
if (zs_ioasic_lk201_cnattach(0x1a0000000, 0x00180000, 0) == 0 &&
tc_3000_300_fb_cnattach(
CTB_TURBOSLOT_SLOT(ctb->ctb_turboslot)) == 0) {
break;
}
#endif
printf("consinit: Unable to init console on keyboard and ");
printf("TURBOchannel slot 0x%lx.\n", ctb->ctb_turboslot);
printf("Using serial console.\n");
case CTB_PRINTERPORT:
{
DELAY(160000000 / 9600);
zs_ioasic_cnattach(0x1a0000000, 0x00100000, 1);
break;
}
default:
printf("ctb->ctb_term_type = 0x%lx\n", ctb->ctb_term_type);
printf("ctb->ctb_turboslot = 0x%lx\n", ctb->ctb_turboslot);
panic("consinit: unknown console type %lu",
ctb->ctb_term_type);
}
}
static void
dec_3000_300_device_register(device_t dev, void *aux)
{
tc_find_bootdev(dev, aux);
}