Beispiel #1
0
int
pcdisplay_match(struct device *parent, void *match, void *aux)
{
	struct isa_attach_args *ia = aux;
	int mono;

	/* If values are hardwired to something that they can't be, punt. */
	if ((ia->ia_iobase != IOBASEUNK &&
	     ia->ia_iobase != 0x3d0 &&
	     ia->ia_iobase != 0x3b0) ||
	    /* ia->ia_iosize != 0 || XXX isa.c */
	    (ia->ia_maddr != MADDRUNK &&
	     ia->ia_maddr != 0xb8000 &&
	     ia->ia_maddr != 0xb0000) ||
	    (ia->ia_msize != 0 && ia->ia_msize != 0x8000) ||
	    ia->ia_irq != IRQUNK || ia->ia_drq != DRQUNK)
		return (0);

	if (pcdisplay_is_console(ia->ia_iot))
		mono = pcdisplay_console_dc.mono;
	else if (ia->ia_iobase != 0x3b0 && ia->ia_maddr != 0xb0000 &&
		 pcdisplay_probe_col(ia->ia_iot, ia->ia_memt))
		mono = 0;
	else if (ia->ia_iobase != 0x3d0 && ia->ia_maddr != 0xb8000 &&
		 pcdisplay_probe_mono(ia->ia_iot, ia->ia_memt))
		mono = 1;
	else
		return (0);

	ia->ia_iobase = mono ? 0x3b0 : 0x3d0;
	ia->ia_iosize = 0x10;
	ia->ia_maddr = mono ? 0xb0000 : 0xb8000;
	ia->ia_msize = 0x8000;
	return (1);
}
Beispiel #2
0
int
pcdisplay_match(device_t parent, cfdata_t match, void *aux)
{
	struct isa_attach_args *ia = aux;
	int mono;

	if (ISA_DIRECT_CONFIG(ia))
		return (0);

	/* If values are hardwired to something that they can't be, punt. */
	if (ia->ia_nio < 1 ||
	    (ia->ia_io[0].ir_addr != ISA_UNKNOWN_PORT &&
	     ia->ia_io[0].ir_addr != 0x3d0 &&
	     ia->ia_io[0].ir_addr != 0x3b0))
		return (0);

	if (ia->ia_niomem < 1 ||
	    (ia->ia_iomem[0].ir_addr != ISA_UNKNOWN_IOMEM &&
	     ia->ia_iomem[0].ir_addr != 0xb8000 &&
	     ia->ia_iomem[0].ir_addr != 0xb0000))
		return (0);
	if (ia->ia_iomem[0].ir_size != 0 &&
	    ia->ia_iomem[0].ir_size != 0x8000)
		return (0);

	if (ia->ia_nirq > 0 &&
	    ia->ia_irq[0].ir_irq != ISA_UNKNOWN_IRQ)
		return (0);

	if (ia->ia_ndrq > 0 &&
	    ia->ia_drq[0].ir_drq != ISA_UNKNOWN_DRQ)
		return (0);

	if (pcdisplay_is_console(ia->ia_iot))
		mono = pcdisplay_console_dc.mono;
	else if (ia->ia_io[0].ir_addr != 0x3b0 &&
		 ia->ia_iomem[0].ir_addr != 0xb0000 &&
		 pcdisplay_probe_col(ia->ia_iot, ia->ia_memt))
		mono = 0;
	else if (ia->ia_io[0].ir_addr != 0x3d0 &&
		 ia->ia_iomem[0].ir_addr != 0xb8000 &&
		 pcdisplay_probe_mono(ia->ia_iot, ia->ia_memt))
		mono = 1;
	else
		return (0);

	ia->ia_nio = 1;
	ia->ia_io[0].ir_addr = mono ? 0x3b0 : 0x3d0;
	ia->ia_io[0].ir_size = 0x10;

	ia->ia_niomem = 1;
	ia->ia_iomem[0].ir_size = mono ? 0xb0000 : 0xb8000;
	ia->ia_iomem[0].ir_size = 0x8000;

	ia->ia_nirq = 0;
	ia->ia_ndrq = 0;

	return (1);
}
Beispiel #3
0
void
pcdisplay_attach(device_t parent, device_t self, void *aux)
{
	struct isa_attach_args *ia = aux;
	struct pcdisplay_softc *sc = device_private(self);
	int console;
	struct pcdisplay_config *dc;
	struct wsemuldisplaydev_attach_args aa;

	printf("\n");

	console = pcdisplay_is_console(ia->ia_iot);

	if (console) {
		dc = &pcdisplay_console_dc;
		sc->nscreens = 1;
		pcdisplay_console_attached = 1;
	} else {
		dc = malloc(sizeof(struct pcdisplay_config),
			    M_DEVBUF, M_WAITOK);
		if (ia->ia_io[0].ir_addr != 0x3b0 &&
		    ia->ia_iomem[0].ir_addr != 0xb0000 &&
		    pcdisplay_probe_col(ia->ia_iot, ia->ia_memt))
			pcdisplay_init(dc, ia->ia_iot, ia->ia_memt, 0);
		else if (ia->ia_io[0].ir_addr != 0x3d0 &&
			 ia->ia_iomem[0].ir_addr != 0xb8000 &&
			 pcdisplay_probe_mono(ia->ia_iot, ia->ia_memt))
			pcdisplay_init(dc, ia->ia_iot, ia->ia_memt, 1);
		else
			panic("pcdisplay_attach: display disappeared");
	}
	sc->sc_dc = dc;

#if NPCWEASEL > 0
	/*
	 * If the display is monochrome, check to see if we have
	 * a PC-Weasel, and initialize its special features.
	 */
	if (dc->mono) {
		sc->sc_weasel.wh_st = dc->dc_ph.ph_memt;
		sc->sc_weasel.wh_sh = dc->dc_ph.ph_memh;
		sc->sc_weasel.wh_parent = self;
		weasel_isa_init(&sc->sc_weasel);
	}
#endif /* NPCWEASEL > 0 */

	aa.console = console;
	aa.scrdata = &pcdisplay_screenlist;
	aa.accessops = &pcdisplay_accessops;
	aa.accesscookie = sc;

	config_found(self, &aa, wsemuldisplaydevprint);
}
Beispiel #4
0
int
pcdisplay_cnattach(bus_space_tag_t iot, bus_space_tag_t memt)
{
	int mono;

	if (pcdisplay_probe_col(iot, memt))
		mono = 0;
	else if (pcdisplay_probe_mono(iot, memt))
		mono = 1;
	else
		return (ENXIO);

	pcdisplay_init(&pcdisplay_console_dc, iot, memt, mono);

	wsdisplay_cnattach(&pcdisplay_scr, &pcdisplay_console_dc,
			   pcdisplay_console_dc.pcs.cursorcol,
			   pcdisplay_console_dc.pcs.cursorrow,
			   FG_LIGHTGREY | BG_BLACK);

	pcdisplayconsole = 1;
	return (0);
}
Beispiel #5
0
void
pcdisplay_attach(struct device *parent, struct device *self, void *aux)
{
	struct isa_attach_args *ia = aux;
	struct pcdisplay_softc *sc = (struct pcdisplay_softc *)self;
	int console;
	struct pcdisplay_config *dc;
	struct wsemuldisplaydev_attach_args aa;

	printf("\n");

	console = pcdisplay_is_console(ia->ia_iot);

	if (console) {
		dc = &pcdisplay_console_dc;
		sc->nscreens = 1;
		pcdisplay_console_attached = 1;
	} else {
		dc = malloc(sizeof(struct pcdisplay_config),
			    M_DEVBUF, M_WAITOK);
		if (ia->ia_iobase != 0x3b0 && ia->ia_maddr != 0xb0000 &&
		    pcdisplay_probe_col(ia->ia_iot, ia->ia_memt))
			pcdisplay_init(dc, ia->ia_iot, ia->ia_memt, 0);
		else if (ia->ia_iobase != 0x3d0 && ia->ia_maddr != 0xb8000 &&
			 pcdisplay_probe_mono(ia->ia_iot, ia->ia_memt))
			pcdisplay_init(dc, ia->ia_iot, ia->ia_memt, 1);
		else
			panic("pcdisplay_attach: display disappeared");
	}
	sc->sc_dc = dc;

	aa.console = console;
	aa.scrdata = &pcdisplay_screenlist;
	aa.accessops = &pcdisplay_accessops;
	aa.accesscookie = sc;
	aa.defaultscreens = 0;

        config_found(self, &aa, wsemuldisplaydevprint);
}