void hd64465uart_attach(struct device *parent, struct device *self, void *aux) { struct hd64465_attach_args *ha = aux; struct hd64465uart_softc *sc = (struct hd64465uart_softc *)self; struct com_softc *csc = &sc->sc_com; sc->sc_chip = &hd64465uart_chip; sc->sc_module_id = ha->ha_module_id; if (!sc->sc_chip->console) hd64465uart_init(); csc->sc_iot = sc->sc_chip->io_tag; bus_space_map(csc->sc_iot, 0, 8, 0, &csc->sc_ioh); csc->sc_iobase = 0; csc->sc_frequency = COM_FREQ; /* supply clock XXX notyet */ /* sanity check */ if (!comprobe1(csc->sc_iot, csc->sc_ioh)) { printf(": device problem. don't attach.\n"); /* stop clock XXX notyet */ return; } com_attach_subr(csc); /* register interrupt handler */ hd64465_intr_establish(HD64465_UART, IST_LEVEL, IPL_TTY, comintr, self); }
void hd64465uartcninit(struct consdev *cp) { hd64465uart_init(); comcnattach(hd64465uart_chip.io_tag, 0x0, COMCN_SPEED, COM_FREQ, COM_TYPE_NORMAL, CONMODE); hd64465uart_chip.console = 1; }
int hd64465uart_kgdb_init() { if (strcmp(kgdb_devname, "hd64465uart") != 0) return (1); if (hd64465uart_chip.console) return (1); /* can't share with console */ hd64465uart_init(); if (com_kgdb_attach(hd64465uart_chip.io_tag, 0x0, kgdb_rate, COM_FREQ, COM_TYPE_NORMAL, CONMODE) != 0) { printf("%s: KGDB console open failed.\n", __func__); return (1); } return (0); }
void hd64465uart_attach(device_t parent, device_t self, void *aux) { struct hd64465_attach_args *ha = aux; struct hd64465uart_softc *sc = device_private(self); struct com_softc *csc = &sc->sc_com; bus_space_handle_t ioh; csc->sc_dev = self; sc->sc_chip = &hd64465uart_chip; sc->sc_module_id = ha->ha_module_id; if (!sc->sc_chip->console) hd64465uart_init(); bus_space_map(sc->sc_chip->io_tag, 0, 8, 0, &ioh); COM_INIT_REGS(csc->sc_regs, sc->sc_chip->io_tag, ioh, 0); csc->sc_frequency = COM_FREQ; /* supply clock XXX notyet */ /* sanity check */ if (!com_probe_subr(&csc->sc_regs)) { aprint_error(": device problem. don't attach.\n"); /* stop clock XXX notyet */ return; } com_attach_subr(csc); /* register interrupt handler */ hd64465_intr_establish(HD64465_UART, IST_LEVEL, IPL_TTY, comintr, self); }