int gbox_dio_match(struct device *parent, void *match, void *aux) { struct dio_attach_args *da = aux; /* We can not appear in DIO-II space */ if (DIO_ISDIOII(da->da_scode)) return (0); if (da->da_id == DIO_DEVICE_ID_FRAMEBUFFER && da->da_secid == DIO_DEVICE_SECID_GATORBOX) return (1); return (0); }
int gbox_dio_match(device_t parent, cfdata_t cf, void *aux) { struct dio_attach_args *da = aux; /* We can not appear in DIO-II space */ if (DIO_ISDIOII(da->da_scode)) return 0; if (da->da_id == DIO_DEVICE_ID_FRAMEBUFFER && da->da_secid == DIO_DEVICE_SECID_GATORBOX) return 1; return 0; }
/* * Locate all bitmapped displays */ void iteconfig() { extern struct hp_hw sc_table[]; int dtype, fboff, slotno, i; u_int8_t *va; struct hp_hw *hw; struct diofbreg *fb; struct ite_data *ip; i = 0; for (hw = sc_table; hw < &sc_table[MAXCTLRS]; hw++) { if (!HW_ISDEV(hw, D_BITMAP)) continue; fb = (struct diofbreg *)hw->hw_kva; /* XXX: redundent but safe */ if (badaddr((caddr_t)fb) || fb->id != GRFHWID) continue; for (dtype = 0; dtype < nitems(itesw); dtype++) if (itesw[dtype].ite_hwid == fb->fbid) break; if (dtype == nitems(itesw)) continue; if (i >= NITE) break; ip = &ite_data[i]; ip->scode = hw->hw_sc; ip->isw = &itesw[dtype]; ip->regbase = (caddr_t)fb; fboff = (fb->fbomsb << 8) | fb->fbolsb; ip->fbbase = (caddr_t) (*((u_char *)ip->regbase+fboff) << 16); /* DIO II: FB offset is relative to select code space */ if (DIO_ISDIOII(ip->scode)) ip->fbbase += (int)ip->regbase; ip->fbwidth = fb->fbwmsb << 8 | fb->fbwlsb; ip->fbheight = fb->fbhmsb << 8 | fb->fbhlsb; ip->dwidth = fb->dwmsb << 8 | fb->dwlsb; ip->dheight = fb->dhmsb << 8 | fb->dhlsb; /* * XXX some displays (e.g. the davinci) appear * to return a display height greater than the * returned FB height. Guess we should go back * to getting the display dimensions from the * fontrom... */ if (ip->dwidth > ip->fbwidth) ip->dwidth = ip->fbwidth; if (ip->dheight > ip->fbheight) ip->dheight = ip->fbheight; /* confirm hardware is what we think it is */ if (itesw[dtype].ite_probe != NULL && (*itesw[dtype].ite_probe)(ip) != 0) continue; ip->alive = 1; i++; } /* * Now probe for SGC frame buffers. */ switch (machineid) { case HP_400: case HP_425: case HP_433: break; default: return; } /* SGC frame buffers can only be STI... */ for (dtype = 0; dtype < nitems(itesw); dtype++) if (itesw[dtype].ite_hwid == GID_STI) break; if (dtype == nitems(itesw)) return; for (slotno = 0; slotno < SGC_NSLOTS; slotno++) { va = (u_int8_t *)IIOV(SGC_BASE + (slotno * SGC_DEVSIZE)); /* Check to see if hardware exists. */ if (badaddr(va) != 0) continue; /* Check hardware. */ if (va[3] == STI_DEVTYPE1) { if (i >= NITE) break; ip = &ite_data[i]; ip->scode = slotno; ip->isw = &itesw[dtype]; ip->regbase = (caddr_t)GRFIADDR; /* to get CN_MIDPRI */ /* ...and do not need an ite_probe() check */ ip->alive = 1; i++; /* we only support one SGC frame buffer at the moment */ break; } } }