blob: 23847f934d64e97d78c78adc2abf3c16b2f8c5e4 [file] [log] [blame]
Alex Eldera646d6e2020-03-05 22:28:27 -06001/* SPDX-License-Identifier: GPL-2.0 */
2
3/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2019-2020 Linaro Ltd.
5 */
6#ifndef _IPA_UC_H_
7#define _IPA_UC_H_
8
9struct ipa;
10
11/**
Alex Elderdc8f7e32021-07-26 15:11:35 -050012 * ipa_uc_config() - Configure the IPA microcontroller subsystem
Alex Eldera646d6e2020-03-05 22:28:27 -060013 * @ipa: IPA pointer
14 */
Alex Elderdc8f7e32021-07-26 15:11:35 -050015void ipa_uc_config(struct ipa *ipa);
Alex Eldera646d6e2020-03-05 22:28:27 -060016
17/**
Alex Elderdc8f7e32021-07-26 15:11:35 -050018 * ipa_uc_deconfig() - Inverse of ipa_uc_config()
Alex Eldera646d6e2020-03-05 22:28:27 -060019 * @ipa: IPA pointer
20 */
Alex Elderdc8f7e32021-07-26 15:11:35 -050021void ipa_uc_deconfig(struct ipa *ipa);
Alex Eldera646d6e2020-03-05 22:28:27 -060022
23/**
Alex Elder7aa0e8b2021-08-20 11:01:28 -050024 * ipa_uc_power() - Take a proxy power reference for the microcontroller
Alex Eldere2f154e2021-07-26 15:11:36 -050025 * @ipa: IPA pointer
26 *
27 * The first time the modem boots, it loads firmware for and starts the
28 * IPA-resident microcontroller. The microcontroller signals that it
29 * has completed its initialization by sending an INIT_COMPLETED response
Alex Elder7aa0e8b2021-08-20 11:01:28 -050030 * message to the AP. The AP must ensure the IPA is powered until
31 * it receives this message, and to do so we take a "proxy" clock
Alex Eldere2f154e2021-07-26 15:11:36 -050032 * reference on its behalf here. Once we receive the INIT_COMPLETED
Alex Elder7aa0e8b2021-08-20 11:01:28 -050033 * message (in ipa_uc_response_hdlr()) we drop this power reference.
Alex Eldere2f154e2021-07-26 15:11:36 -050034 */
Alex Elder7aa0e8b2021-08-20 11:01:28 -050035void ipa_uc_power(struct ipa *ipa);
Alex Eldere2f154e2021-07-26 15:11:36 -050036
37/**
Alex Eldera646d6e2020-03-05 22:28:27 -060038 * ipa_uc_panic_notifier()
39 * @ipa: IPA pointer
40 *
41 * Notifier function called when the system crashes, to inform the
42 * microcontroller of the event.
43 */
44void ipa_uc_panic_notifier(struct ipa *ipa);
45
46#endif /* _IPA_UC_H_ */