static void sitara_cm_attach(device_t parent, device_t self, void *opaque) { struct sitara_cm_softc *sc = device_private(self); struct obio_attach_args *obio = opaque; uint32_t rev; aprint_naive("\n"); if (sitara_cm_sc) panic("sitara_cm_attach: already attached"); sc->sc_dev = self; sc->sc_iot = obio->obio_iot; if (bus_space_map(obio->obio_iot, obio->obio_addr, obio->obio_size, 0, &sc->sc_ioh) != 0) { aprint_error(": couldn't map address space\n"); return ; } sitara_cm_sc = sc; if (sitara_cm_reg_read_4(OMAP2SCM_REVISION, &rev) != 0) panic("sitara_cm_attach: read revision"); aprint_normal(": control module, rev %d.%d\n", SCM_REVISION_MAJOR(rev), SCM_REVISION_MINOR(rev)); }
void sitara_cm_attach(struct device *parent, struct device *self, void *aux) { struct sitara_cm_softc *sc = (struct sitara_cm_softc *)self; struct omap_attach_args *oa = aux; uint32_t rev; if (sitara_cm_sc) panic("sitara_cm_attach: already attached"); sc->sc_iot = oa->oa_iot; if (bus_space_map(oa->oa_iot, oa->oa_dev->mem[0].addr, oa->oa_dev->mem[0].size, 0, &sc->sc_ioh) != 0) panic("%s: bus_space_map failed!\n", __func__); sitara_cm_sc = sc; if (sitara_cm_reg_read_4(OMAP2SCM_REVISION, &rev) != 0) panic("sitara_cm_attach: read revision"); printf(": control module, rev %d.%d\n", SCM_REVISION_MAJOR(rev), SCM_REVISION_MINOR(rev)); }