Lines Matching full:ipa
12 #include "ipa.h"
19 * DOC: The IPA embedded microcontroller
21 * The IPA incorporates a microcontroller that is able to do some additional
31 * A 128 byte block of structured memory within the IPA SRAM is used together
33 * AP and the IPA microcontroller. Each side writes data to the shared area
66 * A shared memory area at the base of IPA resident memory is used for
120 static struct ipa_uc_mem_area *ipa_uc_shared(struct ipa *ipa) in ipa_uc_shared() argument
122 const struct ipa_mem *mem = ipa_mem_find(ipa, IPA_MEM_UC_SHARED); in ipa_uc_shared()
123 u32 offset = ipa->mem_offset + mem->offset; in ipa_uc_shared()
125 return ipa->mem_virt + offset; in ipa_uc_shared()
128 /* Microcontroller event IPA interrupt handler */
129 static void ipa_uc_event_handler(struct ipa *ipa) in ipa_uc_event_handler() argument
131 struct ipa_uc_mem_area *shared = ipa_uc_shared(ipa); in ipa_uc_event_handler()
132 struct device *dev = ipa->dev; in ipa_uc_event_handler()
142 /* Microcontroller response IPA interrupt handler */
143 static void ipa_uc_response_hdlr(struct ipa *ipa) in ipa_uc_response_hdlr() argument
145 struct ipa_uc_mem_area *shared = ipa_uc_shared(ipa); in ipa_uc_response_hdlr()
146 struct device *dev = ipa->dev; in ipa_uc_response_hdlr()
158 if (ipa->uc_powered) { in ipa_uc_response_hdlr()
159 ipa->uc_loaded = true; in ipa_uc_response_hdlr()
160 ipa_power_retention(ipa, true); in ipa_uc_response_hdlr()
163 ipa->uc_powered = false; in ipa_uc_response_hdlr()
175 void ipa_uc_interrupt_handler(struct ipa *ipa, enum ipa_irq_id irq_id) in ipa_uc_interrupt_handler() argument
179 ipa_uc_event_handler(ipa); in ipa_uc_interrupt_handler()
181 ipa_uc_response_hdlr(ipa); in ipa_uc_interrupt_handler()
184 /* Configure the IPA microcontroller subsystem */
185 void ipa_uc_config(struct ipa *ipa) in ipa_uc_config() argument
187 ipa->uc_powered = false; in ipa_uc_config()
188 ipa->uc_loaded = false; in ipa_uc_config()
189 ipa_interrupt_enable(ipa, IPA_IRQ_UC_0); in ipa_uc_config()
190 ipa_interrupt_enable(ipa, IPA_IRQ_UC_1); in ipa_uc_config()
194 void ipa_uc_deconfig(struct ipa *ipa) in ipa_uc_deconfig() argument
196 struct device *dev = ipa->dev; in ipa_uc_deconfig()
198 ipa_interrupt_disable(ipa, IPA_IRQ_UC_1); in ipa_uc_deconfig()
199 ipa_interrupt_disable(ipa, IPA_IRQ_UC_0); in ipa_uc_deconfig()
200 if (ipa->uc_loaded) in ipa_uc_deconfig()
201 ipa_power_retention(ipa, false); in ipa_uc_deconfig()
203 if (!ipa->uc_powered) in ipa_uc_deconfig()
211 void ipa_uc_power(struct ipa *ipa) in ipa_uc_power() argument
213 struct device *dev = ipa->dev; in ipa_uc_power()
227 ipa->uc_powered = true; in ipa_uc_power()
232 static void send_uc_command(struct ipa *ipa, u32 command, u32 command_param) in send_uc_command() argument
234 struct ipa_uc_mem_area *shared = ipa_uc_shared(ipa); in send_uc_command()
246 reg = ipa_reg(ipa, IPA_IRQ_UC); in send_uc_command()
249 iowrite32(val, ipa->reg_virt + reg_offset(reg)); in send_uc_command()
253 void ipa_uc_panic_notifier(struct ipa *ipa) in ipa_uc_panic_notifier() argument
255 if (!ipa->uc_loaded) in ipa_uc_panic_notifier()
258 send_uc_command(ipa, IPA_UC_COMMAND_ERR_FATAL, 0); in ipa_uc_panic_notifier()