/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. * Copyright (C) 2018-2024 Linaro Ltd.
*/
/* DOC: IPA Interrupts * * The IPA has an interrupt line distinct from the interrupt used by the GSI * code. Whereas GSI interrupts are generally related to channel events (like * transfer completions), IPA interrupts are related to other events related * to the IPA. Some of the IPA interrupts come from a microcontroller * embedded in the IPA. Each IPA interrupt type can be both masked and * acknowledged independent of the others. * * Two of the IPA interrupts are initiated by the microcontroller. A third * can be generated to signal the need for a wakeup/resume when an IPA * endpoint has been suspended. There are other IPA events, but at this * time only these three are supported.
*/
/* Process a particular interrupt type that has been received */ staticvoid ipa_interrupt_process(struct ipa_interrupt *interrupt, u32 irq_id)
{ struct ipa *ipa = interrupt->ipa; conststruct reg *reg;
u32 mask = BIT(irq_id);
u32 offset;
switch (irq_id) { case IPA_IRQ_UC_0: case IPA_IRQ_UC_1: /* For microcontroller interrupts, clear the interrupt right * away, "to avoid clearing unhandled interrupts."
*/
iowrite32(mask, ipa->reg_virt + offset);
ipa_uc_interrupt_handler(ipa, irq_id); break;
case IPA_IRQ_TX_SUSPEND: /* Clearing the SUSPEND_TX interrupt also clears the * register that tells us which suspended endpoint(s) * caused the interrupt, so defer clearing until after * the handler has been called.
*/
ipa_interrupt_suspend_clear_all(interrupt);
fallthrough;
default: /* Silently ignore (and clear) any other condition */
iowrite32(mask, ipa->reg_virt + offset); break;
}
}
ret = pm_runtime_get_sync(dev); if (WARN_ON(ret < 0)) goto out_power_put;
/* The status register indicates which conditions are present, * including conditions whose interrupt is not enabled. Handle * only the enabled ones.
*/
reg = ipa_reg(ipa, IPA_IRQ_STTS);
offset = reg_offset(reg);
pending = ioread32(ipa->reg_virt + offset); while ((mask = pending & enabled)) { do {
u32 irq_id = __ffs(mask);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.