Esempio n. 1
0
int
cgeightmatch(struct device *parent, void *vcf, void *aux)
{
	struct cfdata *cf = vcf;
	struct confargs *ca = aux;
	struct romaux *ra = &ca->ca_ra;

	if (strcmp(cf->cf_driver->cd_name, ra->ra_name))
		return (0);

	if (!CPU_ISSUN4 || ca->ca_bustype != BUS_OBIO)
		return (0);

	/*
	 * Make sure there's hardware there.
	 */
	if (probeget(ra->ra_vaddr, 4) == -1)
		return (0);

	/*
	 * Check the pfour register.
	 */
	if (fb_pfour_id(ra->ra_vaddr) == PFOUR_ID_COLOR24)
		return (1);

	return (0);
}
Esempio n. 2
0
int
bwtwomatch(struct device *parent, void *vcf, void *aux)
{
	struct cfdata *cf = vcf;
	struct confargs *ca = aux;
	struct romaux *ra = &ca->ca_ra;

	if (strcmp(cf->cf_driver->cd_name, ra->ra_name))
		return (0);

#if 0
	if (CPU_ISSUN4 && cf->cf_unit != 0)
		return (0);
#endif

	if (ca->ca_bustype == BUS_SBUS)
		return (1);

	/*
	 * Make sure there's hardware there.
	 */
	if (probeget(ra->ra_vaddr, 4) == -1)
		return (0);

	switch (ca->ca_bustype) {
	case BUS_VME16:
	case BUS_VME32:
		return (1);
	case BUS_OBIO:
#if defined(SUN4)
		if (CPU_ISSUN4) {
			/*
			 * Check for a pfour framebuffer, but do not match the
			 * overlay planes for color pfour framebuffers.
			 */
			switch (fb_pfour_id(ra->ra_vaddr)) {
			case PFOUR_ID_BW:
			case PFOUR_NOTPFOUR:
				return (1);
			case PFOUR_ID_COLOR8P1:		/* bwtwo in ... */
			case PFOUR_ID_COLOR24:		/* ...overlay plane */
			default:
				return (0);
			}
		}
#endif
		return (1);
	default:
		return (0);
	}
}
Esempio n. 3
0
int
cgtwomatch(struct device *parent, void *vcf, void *aux)
{
	struct cfdata *cf = vcf;
	struct confargs *ca = aux;
	struct romaux *ra = &ca->ca_ra;
	caddr_t tmp;

	if (strcmp(cf->cf_driver->cd_name, ra->ra_name))
		return (0);

	if (!CPU_ISSUN4 || ca->ca_bustype != BUS_VME16)
		return (0);

	/* XXX - Must do our own mapping at CG2_CTLREG_OFF */
	bus_untmp();
	tmp = (caddr_t)mapdev(ra->ra_reg, TMPMAP_VA, CG2_CTLREG_OFF, NBPG);
	if (probeget(tmp, 2) != -1)
		return (1);

	return (0);
}