xref: /openbmc/linux/drivers/net/ipa/ipa_uc.h (revision 1a0aae88)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4  * Copyright (C) 2019-2022 Linaro Ltd.
5  */
6 #ifndef _IPA_UC_H_
7 #define _IPA_UC_H_
8 
9 struct ipa;
10 enum ipa_irq_id;
11 
12 /**
13  * ipa_uc_interrupt_handler() - Handler for microcontroller IPA interrupts
14  * @ipa:	IPA pointer
15  * @irq_id:	IPA interrupt ID
16  */
17 void ipa_uc_interrupt_handler(struct ipa *ipa, enum ipa_irq_id irq_id);
18 
19 /**
20  * ipa_uc_config() - Configure the IPA microcontroller subsystem
21  * @ipa:	IPA pointer
22  */
23 void ipa_uc_config(struct ipa *ipa);
24 
25 /**
26  * ipa_uc_deconfig() - Inverse of ipa_uc_config()
27  * @ipa:	IPA pointer
28  */
29 void ipa_uc_deconfig(struct ipa *ipa);
30 
31 /**
32  * ipa_uc_power() - Take a proxy power reference for the microcontroller
33  * @ipa:	IPA pointer
34  *
35  * The first time the modem boots, it loads firmware for and starts the
36  * IPA-resident microcontroller.  The microcontroller signals that it
37  * has completed its initialization by sending an INIT_COMPLETED response
38  * message to the AP.  The AP must ensure the IPA is powered until
39  * it receives this message, and to do so we take a "proxy" clock
40  * reference on its behalf here.  Once we receive the INIT_COMPLETED
41  * message (in ipa_uc_response_hdlr()) we drop this power reference.
42  */
43 void ipa_uc_power(struct ipa *ipa);
44 
45 /**
46  * ipa_uc_panic_notifier()
47  * @ipa:	IPA pointer
48  *
49  * Notifier function called when the system crashes, to inform the
50  * microcontroller of the event.
51  */
52 void ipa_uc_panic_notifier(struct ipa *ipa);
53 
54 #endif /* _IPA_UC_H_ */
55