Lines Matching refs:tzic

90 #define	INTC_READ(tzic, reg) \
91 bus_space_read_4((tzic)->sc_iot, (tzic)->sc_ioh, (reg))
92 #define INTC_WRITE(tzic, reg, val) \
93 bus_space_write_4((tzic)->sc_iot, (tzic)->sc_ioh, (reg), (val))
101 CFATTACH_DECL_NEW(tzic, sizeof(struct tzic_softc),
122 struct tzic_softc *tzic = device_private(self);
132 tzic->sc_dev = self;
133 tzic->sc_iot = aa->aa_iot;
135 tzic_softc = tzic;
140 error = bus_space_map(tzic->sc_iot, aa->aa_addr, aa->aa_size, 0, &tzic->sc_ioh);
149 tzic_intr_init(tzic);
151 tzic->sc_pic.pic_ops = &tzic_pic_ops;
152 tzic->sc_pic.pic_maxsources = TZIC_INTNUM;
153 strlcpy(tzic->sc_pic.pic_name, device_xname(self),
154 sizeof(tzic->sc_pic.pic_name));
156 pic_add(&tzic->sc_pic, aa->aa_irqbase);
158 aprint_normal_dev(tzic->sc_dev, "interrupts %d..%d register VA:%p\n",
160 (void *)tzic->sc_ioh);
170 struct tzic_softc * const tzic = PIC_TO_SOFTC(pic);
173 KASSERT((irq_mask & tzic->sc_enabled_mask[group]) == 0);
175 tzic->sc_enabled_mask[group] |= irq_mask;
176 INTC_WRITE(tzic, TZIC_ENSET(group), irq_mask);
182 struct tzic_softc * const tzic = PIC_TO_SOFTC(pic);
185 tzic->sc_enabled_mask[group] &= ~irq_mask;
187 INTC_WRITE(tzic, TZIC_ENCLEAR(group), irq_mask);
194 find_pending_irqs(struct tzic_softc *tzic, size_t group)
200 pending = INTC_READ(tzic, TZIC_PND(group));
202 KASSERT((tzic->sc_enabled_mask[group] & pending) == pending);
207 return pic_mark_pending_sources(&tzic->sc_pic, group * 32, pending);
213 struct tzic_softc * const tzic = PIC_TO_SOFTC(pic);
224 reg = INTC_READ(tzic, TZIC_PRIORITY(priority_offset));
227 INTC_WRITE(tzic, TZIC_PRIORITY(priority_offset), reg);
260 tzic_intr_init(struct tzic_softc * const tzic)
266 (void) INTC_READ(tzic, TZIC_INTCNTL);
267 INTC_WRITE(tzic, TZIC_INTCNTL, INTCNTL_NSEN_MASK|INTCNTL_NSEN|INTCNTL_EN);
268 (void) INTC_READ(tzic, TZIC_INTCNTL);
269 INTC_WRITE(tzic, TZIC_PRIOMASK, SW_TO_HW_IPL(IPL_NONE));
270 (void) INTC_READ(tzic, TZIC_PRIOMASK);
272 INTC_WRITE(tzic, TZIC_SYNCCTRL, 0x00);
273 (void) INTC_READ(tzic, TZIC_SYNCCTRL);
277 INTC_WRITE(tzic, TZIC_INTSEC(i), 0xffffffff);
281 INTC_WRITE(tzic, TZIC_ENCLEAR(i), 0xffffffff);