CDSPRM module implements a RPMSG interface to communicate with CDSP
while providing a way for CDSP to vote for CPU L3 clock, CPU QoS to
benefit CDSP applications performance. The module also implements
an interface with NPU for Cx i-peak limit management and registers
cooling devices for CDSP and HVX thermal mitigation.
Change-Id: I5aa592cb8de19367f7361e1f31d1077ceba386df
Acked-by: Sreekanth Gande <sgande@qti.qualcomm.com>
Signed-off-by: Bavyasritha Alahari <alahari@codeaurora.org>
Setting a fake battery SOC (state of charge) is useful to test
different mitigation levels. Add support for it by exposing
fake_soc under qcom-battery class which can be set only when
CONFIG_QTI_PMIC_GLINK_CLIENT_DEBUG is enabled.
To set fake_soc of 50%,
echo 50 > /sys/class/qcom-battery/fake_soc
To clear fake_soc so that actual battery SOC can be displayed,
any value other than 0-100 can be set to fake_soc.
echo -1 > /sys/class/qcom-battery/fake_soc
Change-Id: Ibff337fb4da9d4e9aadbe148f3eecca9e2d69604
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Currently, data received from the remote subsystem is delivered
to the clients as-is if they've registered for receiving it. This
can cause unintended extraneous buffer reads if the length of the
received message is too small. Verify that the message length is
at least the PMIC Glink header size.
Change-Id: I3774d9d5331794c509bda89f40f4ead2e0ed3843
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
There are Non-VM (Virtual Machine) supported target drivers which
may refer some of the APIs defined for VMs. But those drivers are
compiled irrespective of VM or non-VM configurations. Add stubs to
support to compile drivers for non vm supported targets.
Change-Id: Ibc0c2c55b3b264c43c4793f153e723f8d344423a
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
Register driver should be skipped if reboot is already in progress.
Also firmware boot timer should be stopped if register driver work
has been scheduled but gets killed later to avoid timing out because
of the reboot.
Change-Id: Iae4de860329a82416bfa58967095a4de7b509813
Signed-off-by: Yue Ma <yuem@codeaurora.org>
If RM is not set up, drivers such as ion may be frequently calling
hh_rm_get_vmid and causing a console message that a VMID could not be
found. Drivers should be correctly handling the error case, so remove
the pr_err here to not fill console messages.
Change-Id: I2026d9481b6d58a89fb2f546bf76b29566e5f3d7
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Add library for client drivers to lend interrupts to each other.
Change-Id: I4c60e0443d178e83c0bb4ec824915e4bdadb9c39
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
A VM may release a lent IRQ back to its lender. The lendee VM notifies
the resource manager that it may give the interrupt back to the lender
via its interrupt handle. The lender then must notify the lender VM that
it has released the interrupt. The lender VM must then reclaim the
interrupt via the handle.
Change-Id: Ic76f5a3692b4041bc3f260b4add06da11746f19e
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
An IRQ lender driver will likely ought to need to use the IRQ handle to
reclaim the interrupt when the lendee is done with the interrupt.
Change-Id: I0b791ecfb7b169d5cf2677d324e9aceea51feb5d
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
IRQ notify sends only a standard response without any client data to
parse. Update irq_notify to expect to not receive any client data.
Change-Id: Ie5db403a84a0b237ca34a2b06c8a1b76ec92cf79
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
VMID is represented inconsistently in payload structs. Consistently use
hh_vmid_t to reduce mistakes around sizing of vmid. IRQ notify request
payload was also incorrectly formatted according to specification.
Change-Id: I0875655f69946eb0af609c67bdfdfa0dab5c7acc
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
RM core driver can send out multiple requests in parallel to RM, e.g.
00111002302222113456111 (numbers indicate seq-id, and the recursion of a
number indicates fragments). RM can only process one request at a time
and would reject any messages unrelated to the request it was first
receiving. Thus, add a lock to enforce requests are sent sequentially.
Change-Id: I1e75dd40d7b8bf47ca4120f33c70f1ee452ba7b1
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
RM will only ever send one stream of fragmented messages to a VM.
Additionally, sequence number should not be used to track notification
fragments. We cannot use IDR sequence pool to associate fragments
with a particular connection. Thus, maintain a current connection to
directly append to when receiving continuation fragments.
Connection streams have a consistent num_fragments and message ID which
can be used to do self-sanity checks instead of sequence number. Use
these fields instead.
Change-Id: I18113868b9fd20d3c9f7f66933cdcfb8c0f29362
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Console initialization may send data to driver during call to
hvc_instantiate. Thus, these data structures must be initialized before
this call. Reorganize driver initialization to meet this requirement and
improve comments and error handling during initialization.
Change-Id: Ia7b9bc9e2244516d86695839830ff4a16863342a
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Improve print statements around errors to provide more useful
information and add hex dumps of data being sent to RM and over message
queues. Hex dump of the message is invaluable to validating whether
messages are correctly being formatted.
Change-Id: I95dc665ce00795f347d4820178e09bf43b8f31c3
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Update handling of msgq response to send/recv to update internal state of
rx_empty/tx_full.
Change-Id: I8c744b2ed1dafc9b89576eb216a790d4f59530f5
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
RM accepts "VMID 0" as meaning "self." Thus, add a vm_name "HH_SELF_VM"
which means the same. Haven RM console operates on vm_names and can use
HH_SELF_VM to talk to RM about this VM's console.
Change-Id: I7663db28497ad86a94d4a8c98f3b7068f5644915
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Remove the duplicated cti map for tmc-etr as only memory mode needs
the cti map.
Change-Id: I5264a41e718924cd2febb8c0e7de03623fbd7c90
Signed-off-by: Mao Jinlong <jinlmao@codeaurora.org>
After sending PME_TURNOFF message via ELBI_SYS_CTRL register,
remove read back to the register to avoid possible hang.
Change-Id: Ie424006991f10f12127f9b5a07a93c291c7a2f10
Signed-off-by: Tony Truong <truong@codeaurora.org>