Add symbols currently present on kalama as of msm-5.15
'commit 1701298d2205 ("Merge "defconfig:kalama_consolidate: Enable
CONFIG_UFS_DBG"").
Change-Id: Ie9570f48bbcef1c32e49f629e079cf7af0f572a9
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Some QoS enable urgent forwarding by default, but we don't always want
this. So don't assume the register already has zero and write it
unconditionally.
Change-Id: I257e099a588870f8d6e6d68b7fd794e22781450e
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Skip bcm init and implement stubs for icc apis when stub property
is defined.
Change-Id: Ic56a75578b6fa4fe35bebaf103d41205e444efed
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
Add support for QCOM_ICC_TAG_PERF_MODE on RPMh architectures. When
QCOM_ICC_TAG_PERF_MODE is specified using icc_set_tag(), each node in
the requested path will use latency-optimized settings if supported by
the node. The improved latency comes at the cost of higher power.
Change-Id: I83c52e5677f8842b4c17987053d566971b84086f
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Add binding for QCOM_ICC_TAG_PERF_MODE, which can be used with
icc_set_tag() to indicate that the path should use latency-optimized
settings for each node in the path if supported.
Change-Id: I748df7bdaa79784ade4ad9a135e4f91b92b97513
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Some BCMs aren't directly associated with the data path (i.e. ACV) and
therefore don't communicate using BW. Instead, they are simply
enabled/disabled with a simple bit mask. Add support for these.
Change-Id: I9b73e0ce05a09338d22571ff311c5b058fb8e1b2
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Some BCMs that aren't directly associated with NOC ports (i.e. ACV)
publish their width as 0 in cmd_db. The client votes are multiplied by
this width when adjusting for node/BCM width differences. This means a
zero width also zeroes the client votes, making it impossible to vote on
these zero-width BCMs. Set a width floor of 1 to allow aggregation on
these nodes.
Also set a floor on the BCM units. They should never by 0 in cmd_db, but
if they are it would cause a div-by-zero.
Change-Id: I14ba89411ec02077db6d2c27b6de932c5b7dfe1e
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Currently avg and peak bandwidth are voted as allowed max on kernel boot.
Add stub icc_get_bw() callback that return default avg, peak bandwidth.
Change-Id: I5c42f933d770e2c63c8bbc2d8e7afe5b9748ba1d
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
Add a debug library that provides QCOM-specific interconnect debug
features. This includes support for printing all enabled interconnect
votes to console when entering suspend.
Change-Id: I61302f95c94176f833bd1c88ddc76b88121b3f79
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Add stub icc_set() and icc_aggregate() callbacks that return success
without doing anything. These can be used early in development before
the rest of the system is ready to service RPMh requests. Additionally,
they can be used during probe to avoid unnecessary set/aggregate() calls
each time icc_node_add() is called.
Change-Id: If495ffc8f9839c3d2651c166c62a7936927e3c02
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
AMC requests made while the RSC is in solver mode result in a -EBUSY
response from the rpmh driver. This is expected and is a non-issue since
in this case we just need the request to apply to the WAKE set instead.
It's only possible to see this for secondary RSCs like the Display RSC,
since the primary Apps RSC will only be in solver during the power
collapse/restore sequences while SW isn't running. Ignore -EBUSY so we
don't return an error and short-circuit before sending the necessary
WAKE/SLEEP requests.
Change-Id: Id34b91c6e46d282be2522434d3c2b4837291b3b7
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Add support for targeting alternate bcm-voters which
live under different RSC devices.
Change-Id: Ia1ad8a4c6c6b8531f0dae67cc7b22e2faa55c418
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Signed-off-by: Georgi Djakov <gdjako@codeaurora.org>
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Introduce support to initialize QoS settings for
QNOC platforms.
Change-Id: I17a237e88f21f7bbc98621d072fff9c1b1bc6403
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Signed-off-by: Odelu Kukatla <okukatla@codeaurora.org>
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Add sync_state functionality to remove threshold held during initial
boot up and clean up any linger proxy resources that were voted for
from bootloaders.
Change-Id: Ib2fe3f3e54775b85c3ee8107c9aafdcd32841017
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
Add a high bandwidth vote for critical NoCs during boot up.
Change-Id: I739df67083e13f542c0021054b1ca4c1f2d9bd09
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Add the required APIs utilized by the USB drivers to the ABI symbol list.
Change-Id: I9797ab4e71438c4ddbb9f06fc3c2e3dbb91acb5e
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Take a snapshot of our DMA-BUF heap driver as of commit f843a80d2c45
("Merge "defconfig: gen3auto: Separated if_changed"") on msm-5.15.
On top of taking the snapshot, make the following changes:
- Remove the references to the deferred free helper, which will be
added later.
- Remove the references to the pool size getters, which will be
added later.
- Add the deferred mapping driver.
- Remove the heap helper buffer, and associated headers / inclusions
(these are unused).
- Remove the bitstream contig heap as this is no longer required.
Change-Id: Ib98b08139d11940f4f0030294c6c7c18897f6531
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
Take a snapshot of the qcom-dma-mapping.h header as of commit
f843a80d2c45 ("Merge "defconfig: gen3auto: Separated if_changed"") on
msm-5.15, excluding any Gunyah references (as the Gunyah driver has
yet to be ported).
Change-Id: I0549feb28eedb80668f1233576c365aefc3a8e6e
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
When running build_abi.sh, mixed build is explicitly disabled. In that
case, turn on some options for trimming and strict mode which would
normally be disabled because they conflict with mixed build.
Change-Id: I545705e14c2f55b72986e579724713de95e08dfd
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Add a check to ensure that the remote subsystem sends the full and
expected length of the notification message.
Change-Id: I78d2c708c924cb864b7636bda81f290e310beb54
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Execute the client's callback in a separate thread to avoid the
following deadlock situation:
- altmode_callback() calls the client's callback when a valid amclient
is found and program execution waits for it to finish.
- The client's callback calls altmode_send_data() to send the PAN_ACK.
- altmode_send_data() eventually calls altmode_write(), which is waiting
for the response_received to be "completed" in altmode_callback().
- For response_received to be "completed", altmode_callback() must
finish executing in order to process the USBC_CMD_WRITE_REQ message
received from the remote subsystem.
- altmode_callback() cannot finish executing until altmode_send_data()
returns.
- altmode_send_data() times out and passes on the error to the client.
Also perform the following:
- Add a check to ensure that the payload received from the remote
subsystem is at least 9 bytes long.
- Prevent out of bounds access for USBC_CMD_WRITE_REQ message (which is
of a different format than struct usbc_notify_ind_msg) by moving the
port_index reading to only the USBC_NOTIFY_IND message in
altmode_callback().
CRs-Fixed: 2713590
Fixes: 6c0ffc67e574 ("soc: altmode: Detect when remote subsys fails to respond")
Change-Id: I0f2c6ce0f843c43c9e7e301be9ff3ad913310f62
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
The remote subsystem acknowledges all Altmode PMIC GLINK messages sent
to it. Print an error message anytime it fails to do this.
In the case when no client is found for a received message, do the
sending of the ack in a separate worker thread instead of a plain
function call to altmode_send_ack(). This is to avoid a deadlock and
consequent timing out in altmode_write(), which will happen in the
following scenario:
- A message is received for a nonexistent client.
- altmode_send_ack() is called from within altmode_callback().
- The PAN ACK is sent to the remote subsystem via pmic_glink_write() in
altmode_write() and the remote subsystem replies with an ACK (opcode
USBC_CMD_WRITE_REQ).
- Subsequently, in altmode_write() we wait for completion timeout, which
will happen only if this new ACK message is processed by PMIC GLINK.
- PMIC GLINK is waiting for altmode_callback() to return so that it can
process the new message.
- We are still waiting in altmode_callback() for altmode_send_ack() to
complete.
- We time out in altmode_write() waiting for the completion to occur.
This problem is solved by firing off a worker thread to send the PAN ACK
so that altmode_callback() can exit quickly and allow the incoming new
ACK to hit the complete() in the USBC_CMD_WRITE_REQ case in
altmode_callback().
Also add a couple of minor fixes to some debug messages while we're at
it.
Change-Id: I3d80b1a7d6cc03b0eba61b5c9cc660ce7d377942
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Add debugfs nodes to send Pin Assignment Notifications Enable (PAN EN)
and Acknowledgment (ACK) commands manually if needed, to aid in
debugging situations where it is unclear whether clients are sending
these commands synchronously as per design.
Change-Id: I7a68d676df86cbf6952158202c8e4958db032d5b
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Remove the device tree property "qcom,altmode-name" and the logic it
feeds as it was meant to help in the cases when there are multiple
altmode devices. Since there is going to be only one altmode device as
per design, this is no longer needed.
Change-Id: Ife15e39becee5f4ff03bdcc56ff62ae812fe2726
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Client API changes:
- Update client APIs to align them more closely with upstream
conventions.
- In particular, change the link between altmode device and client from
the altmode device's name string to a phandle to the altmode device
followed by the port index of the client.
- Instead of using solely the client's SVID as the key for idr_alloc,
include port_index as well because the unique identifier of a client
is the (SVID, port_index) tuple.
Updates to client notifying mechanism:
- Get rid of the standard notifier APIs in favour of a simpler callback
function-based mechanism to notify clients of probe completion.
- In addition, if clients probe after altmode finishes probing, they
will not get notified of probe completion as this is done only once at
the end of altmode_probe(). Fix this so that if a client registers for
probe completion notifications after altmode probes, they get notified
immediately.
While at it, get rid of the global list of altmode devices (amdev_list)
as there will only be a single altmode device in the system as per
design.
Change-Id: Iea450d30d9cc94671f505b7ff0c6e98b0b8a4467
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Add subsystem restart (SSR) support to altmode glink driver so
that when subsystem goes down and comes up again, it can send
PAN_EN to charger firmware to receive notifications about altmode
interface.
Change-Id: Ie011d5110b6c26790fe1dd6149115019f8bc261c
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
The Type-C standard defines various "alternate (alt) modes" which enable
standard Type-C connectors to carry non-USB signals and data.
This driver provides an interface for Type-C alternate mode clients to
receive data such as Pin Assignment Notifications from the Type-C stack
running on a remote subsystem (e.g. DSP) via the PMIC GLINK interface.
Change-Id: Ic7eacb6901830cab181d91a1775cf02cddbccae2
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Currently, qti_battery_debug driver supports collecting QBG
context dump only for 1S battery. Add support to collect QBG
context dump for more than single cell to support 2S battery.
User can set "battery_cell_id" to select the QBG context dump
they would like to receive from the charger firmware that runs
on a remote subsystem.
Change-Id: I863b908a8c5bfae441431d31ac4dc8a491a0310c
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Replace the "qbg_context" debugfs blob with a binary file associated
with the battery_debug device that provides the same functionality as
the existing debugfs blob for getting QBG context.
Usage:
# cd /sys/devices/platform/soc/soc:qcom,pmic_glink_log/\
soc:qcom,pmic_glink_log:qcom,battery_debug
# echo 1 > qbg_context
# cat qbg_context > file.bin
Change-Id: I59cfea2880362a95d8c87c02b4d823bfdca4e1e2
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Ensure that valid memory is allocated for the array of all votables
before an attempt is made to populate it.
Change-Id: I9a0c3e35e345a88560e39d47484348b6c476628d
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
As a preparatory move to adding device attributes to the battery_debug
device, remove the dependency on DEBUG_FS for driver enablement and add
config guards in the driver instead.
Change-Id: I8fcb385a583564935ce472416552e25ca79f4a84
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Add debugfs nodes to read and set votables from the firmware running on
the remote subsystem (e.g. DSP).
Also modify error handling logic in battery_dbg_add_debugfs().
Change-Id: I50f191add22cd500e04475f264e86cf16c6be48f
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>