int dnkbd_init(void) { /* * 400, 425, and 433 models can have a Domain keyboard. */ switch (machineid) { case HP_400: case HP_425: case HP_433: break; default: return 0; } /* * Look for a Frodo utility chip. If we find one, assume there * is a Domain keyboard attached. */ if (badaddr((void *)IIOV(FRODO_BASE + FRODO_APCI_OFFSET(0)))) return 0; /* * XXX Any other initialization? This appears to work ok. */ return 1; }
int dnkbd_init() { /* * 362, 382, 400, 425, and 433 models can have a Domain keyboard. * Note that we do not tell 360 from 362 in the bootblocks. */ switch (machineid) { case HP_360: case HP_382: case HP_400: case HP_425: case HP_433: break; default: return (0); } /* * Look for a Frodo utility chip. If we find one, assume there * is a Domain keyboard attached. */ if (badaddr((caddr_t)IIOV(FRODO_BASE + FRODO_APCI_OFFSET(0)))) return (0); /* * XXX Any other initialization? This appears to work ok. */ return (1); }
int dnkbd_match(struct device *parent, void *match, void *aux) { struct frodo_attach_args *fa = aux; if (strcmp(fa->fa_name, dnkbd_cd.cd_name) != 0) return (0); /* only attach to the first frodo port */ return (fa->fa_offset == FRODO_APCI_OFFSET(0)); }
int dnkbd_getc(void) { struct apciregs *apci = (struct apciregs *)IIOV(FRODO_BASE + FRODO_APCI_OFFSET(0)); int c; /* default to `no key' */ c = 0; /* Is data in the UART? */ if (apci->ap_lsr & LSR_RXRDY) { /* Get the character. */ c = apci->ap_data; /* Ignoring mouse? */ if (dnkbd_ignore) { dnkbd_ignore--; return 0; } /* Is this the start of a mouse packet? */ if (c == 0xdf) { dnkbd_ignore = 3; /* 3 bytes of junk */ return 0; } /* It's a keyboard event. */ switch (dnkbd_keymap[c]) { case 0x00: /* passthrough */ break; case 0xff: /* ignore */ c = 0; break; default: c = dnkbd_keymap[c]; break; } } return c; }
void apciprobe(struct consdev *cp) { apcicnaddr = (void *)IIOV(FRODO_BASE + FRODO_APCI_OFFSET(1)); cp->cn_pri = CN_DEAD; /* * Only a 425e can have an APCI console. On all other 4xx models, * the "first" serial port is mapped to the DCA at select code 9. */ if (machineid != HP_425 || mmuid != MMUID_425_E) return; #ifdef FORCEAPCICONSOLE cp->cn_pri = CN_REMOTE; #else cp->cn_pri = CN_NORMAL; #endif curcons_scode = -2; }
void hp300_cninit(void) { struct bus_space_tag tag; bus_space_tag_t bst; bst = &tag; memset(bst, 0, sizeof(struct bus_space_tag)); bst->bustype = HP300_BUS_SPACE_INTIO; /* * Look for serial consoles first. */ #if NCOM_FRODO > 0 if (!com_frodo_cnattach(bst, FRODO_BASE + FRODO_APCI_OFFSET(1), -1)) return; #endif #if NCOM_DIO > 0 if (!dio_scan(com_dio_cnattach)) return; #endif #if NDCM > 0 if (!dio_scan(dcmcnattach)) return; #endif #if NITE > 0 #ifndef CONSCODE /* * Look for internal framebuffers. */ #if NDVBOX > 0 if (!dvboxcnattach(bst, FB_BASE,-1)) goto find_kbd; #endif #if NGBOX > 0 if (!gboxcnattach(bst, FB_BASE,-1)) goto find_kbd; #endif #if NRBOX > 0 if (!rboxcnattach(bst, FB_BASE,-1)) goto find_kbd; #endif #if NTOPCAT > 0 if (!topcatcnattach(bst, FB_BASE,-1)) goto find_kbd; #endif #endif /* CONSCODE */ /* * Look for external framebuffers. */ #if NDVBOX > 0 if (!dio_scan(dvboxcnattach)) goto find_kbd; #endif #if NGBOX > 0 if (!dio_scan(gboxcnattach)) goto find_kbd; #endif #if NHYPER > 0 if (!dio_scan(hypercnattach)) goto find_kbd; #endif #if NRBOX > 0 if (!dio_scan(rboxcnattach)) goto find_kbd; #endif #if NTOPCAT > 0 if (!dio_scan(topcatcnattach)) goto find_kbd; #endif find_kbd: #if NDNKBD > 0 dnkbdcnattach(bst, FRODO_BASE + FRODO_APCI_OFFSET(0)) #endif #if NHIL > 0 hilkbdcnattach(bst, HIL_BASE); #endif #endif /* NITE */ }