Lines Matching full:ipa

11 #include "ipa.h"
16 * DOC: The IPA embedded microcontroller
18 * The IPA incorporates a microcontroller that is able to do some additional
28 * A 128 byte block of structured memory within the IPA SRAM is used together
30 * AP and the IPA microcontroller. Each side writes data to the shared area
63 * A shared memory area at the base of IPA resident memory is used for
117 static struct ipa_uc_mem_area *ipa_uc_shared(struct ipa *ipa) in ipa_uc_shared() argument
119 u32 offset = ipa->mem_offset + ipa->mem[IPA_MEM_UC_SHARED].offset; in ipa_uc_shared()
121 return ipa->mem_virt + offset; in ipa_uc_shared()
124 /* Microcontroller event IPA interrupt handler */
125 static void ipa_uc_event_handler(struct ipa *ipa, enum ipa_irq_id irq_id) in ipa_uc_event_handler() argument
127 struct ipa_uc_mem_area *shared = ipa_uc_shared(ipa); in ipa_uc_event_handler()
128 struct device *dev = &ipa->pdev->dev; in ipa_uc_event_handler()
137 /* Microcontroller response IPA interrupt handler */
138 static void ipa_uc_response_hdlr(struct ipa *ipa, enum ipa_irq_id irq_id) in ipa_uc_response_hdlr() argument
140 struct ipa_uc_mem_area *shared = ipa_uc_shared(ipa); in ipa_uc_response_hdlr()
152 ipa->uc_loaded = true; in ipa_uc_response_hdlr()
153 ipa_clock_put(ipa); in ipa_uc_response_hdlr()
156 dev_warn(&ipa->pdev->dev, in ipa_uc_response_hdlr()
164 void ipa_uc_setup(struct ipa *ipa) in ipa_uc_setup() argument
166 /* The microcontroller needs the IPA clock running until it has in ipa_uc_setup()
169 * we have finished doing the rest of the IPA initialization, so we in ipa_uc_setup()
174 ipa_clock_get(ipa); in ipa_uc_setup()
176 ipa->uc_loaded = false; in ipa_uc_setup()
177 ipa_interrupt_add(ipa->interrupt, IPA_IRQ_UC_0, ipa_uc_event_handler); in ipa_uc_setup()
178 ipa_interrupt_add(ipa->interrupt, IPA_IRQ_UC_1, ipa_uc_response_hdlr); in ipa_uc_setup()
182 void ipa_uc_teardown(struct ipa *ipa) in ipa_uc_teardown() argument
184 ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_1); in ipa_uc_teardown()
185 ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_0); in ipa_uc_teardown()
186 if (!ipa->uc_loaded) in ipa_uc_teardown()
187 ipa_clock_put(ipa); in ipa_uc_teardown()
191 static void send_uc_command(struct ipa *ipa, u32 command, u32 command_param) in send_uc_command() argument
193 struct ipa_uc_mem_area *shared = ipa_uc_shared(ipa); in send_uc_command()
201 iowrite32(1, ipa->reg_virt + IPA_REG_IRQ_UC_OFFSET); in send_uc_command()
205 void ipa_uc_panic_notifier(struct ipa *ipa) in ipa_uc_panic_notifier() argument
207 if (!ipa->uc_loaded) in ipa_uc_panic_notifier()
210 send_uc_command(ipa, IPA_UC_COMMAND_ERR_FATAL, 0); in ipa_uc_panic_notifier()