void obioattach(struct device *parent, struct device *self, void *aux) { uint i; /* * Map and setup CRIME control registers. */ if (bus_space_map(&obio_tag, OCTEON_CIU_BASE, OCTEON_CIU_SIZE, 0, &obio_h)) { printf(": can't map CIU control registers\n"); return; } printf("\n"); obio_intr_init(); set_intr(INTPRI_CIU_0, CR_INT_0, obio_iointr); register_splx_handler(obio_splx); /* * Attach subdevices. */ for (i = 0; i < nitems(obio_children); i++) config_found_sm(self, obio_children + i, obioprint, obiosubmatch); }
void macebusattach(struct device *parent, struct device *self, void *aux) { u_int32_t creg; uint i; /* * Map and setup CRIME control registers. */ if (bus_space_map(&crimebus_tag, 0x00000000, 0x400, 0, &crime_h)) { printf(": can't map CRIME control registers\n"); return; } creg = bus_space_read_8(&crimebus_tag, crime_h, CRIME_REVISION); printf(": crime rev %d.%d\n", (creg & 0xf0) >> 4, creg & 0xf); bus_space_write_8(&crimebus_tag, crime_h, CRIME_CPU_ERROR_STAT, 0); bus_space_write_8(&crimebus_tag, crime_h, CRIME_MEM_ERROR_STAT, 0); bus_space_write_8(&crimebus_tag, crime_h, CRIME_INT_MASK, 0); bus_space_write_8(&crimebus_tag, crime_h, CRIME_INT_SOFT, 0); bus_space_write_8(&crimebus_tag, crime_h, CRIME_INT_HARD, 0); bus_space_write_8(&crimebus_tag, crime_h, CRIME_INT_STAT, 0); /* * Map and setup MACE ISA control registers. */ if (bus_space_map(&macebus_tag, MACE_ISA_OFFS, 0x400, 0, &mace_h)) { printf("%s: can't map MACE control registers\n", self->dv_xname); return; } bus_space_write_8(&macebus_tag, mace_h, MACE_ISA_INT_MASK, 0); bus_space_write_8(&macebus_tag, mace_h, MACE_ISA_INT_STAT, 0); /* * On O2 systems all interrupts are handled by the macebus interrupt * handler. Register all except clock. */ set_intr(INTPRI_MACEIO, CR_INT_0, macebus_iointr); register_splx_handler(macebus_splx); /* Set up a handler called when clock interrupts go off. */ set_intr(INTPRI_MACEAUX, CR_INT_5, macebus_aux); /* * Attach subdevices. */ for (i = 0; i < nitems(macebus_children); i++) config_found_sm(self, macebus_children + i, macebusprint, macebussubmatch); }