Commit Graph

1073521 Commits

Author SHA1 Message Date
qctecmdr
22c17bcabb Merge "interconnect: qcom: qnoc-qos: Don't skip writing urg_fwd when it's zero" 2022-05-06 21:19:37 -07:00
qctecmdr
6d53b5c5f8 Merge "interconnect: qcom: Add stub icc_set/aggregate() callbacks" 2022-05-06 18:58:48 -07:00
qctecmdr
05fd6cf81b Merge "soc: altmode: Add correct notify message length check" 2022-05-06 16:28:47 -07:00
qctecmdr
ce01c25ee7 Merge "soc: qcom: altmode-glink: add SSR support" 2022-05-06 14:00:40 -07:00
qctecmdr
0e80a8e22e Merge "soc: qcom: add initial version of qti_battery_debug driver" 2022-05-06 11:38:08 -07:00
qctecmdr
d1b8d9dbc6 Merge "drivers: soc: qcom: Add soft dependency of smem on hwspinlock" 2022-05-05 13:21:21 -07:00
Rishabh Bhatnagar
bbe2be8810 drivers: soc: qcom: Add soft dependency of smem on hwspinlock
Add module soft dependency of smem on qcom_hwspinlock driver.

Change-Id: If11256cb5acc133f7725f0c3b2ec708c53e2c328
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
2022-05-05 10:33:09 -07:00
qctecmdr
fb81948309 Merge "dma-heap: qcom: Take a snapshot of our DMA-BUF heap driver from msm-5.15" 2022-05-05 08:39:09 -07:00
qctecmdr
301f2078bd Merge "mem-buf: Take a snapshot of mem-buf-exporter.h from msm-5.15" 2022-05-04 19:03:45 -07:00
qctecmdr
6631289b86 Merge "arm64: defconfig: Add support for QCOM USB subsystem" 2022-05-04 12:47:13 -07:00
qctecmdr
6b1d10529a Merge "soc: qcom: smem: validate fields of shared structures" 2022-05-04 10:30:20 -07:00
Wesley Cheng
97c04070f3 arm64: defconfig: Add support for QCOM USB subsystem
Enable configurations for DWC3 MSM and EMU USB PHY drivers.

Change-Id: If725c0a2627c34bb2ee6305f88412c6caffc31be
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2022-05-04 10:00:48 -07:00
qctecmdr
816396e98a Merge "soc: qcom: smem: map only partitions used by local HOST" 2022-05-03 14:14:55 -07:00
Guru Das Srinagesh
3465d8be3c abi_gki_aarch64_qcom: Update list of symbols
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>
2022-05-02 12:18:07 -07:00
Mike Tipton
81216c014f interconnect: qcom: qnoc-qos: Don't skip writing urg_fwd when it's zero
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>
2022-05-02 09:07:16 -07:00
Vivek Aknurwar
bc2e1198cc interconnect: qcom: icc-rpmh: Implement stub handling
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>
2022-05-02 09:07:16 -07:00
Mike Tipton
bdebb74665 interconnect: qcom: Add support for PERF_MODE on RPMh targets
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>
2022-05-02 09:07:16 -07:00
Mike Tipton
1f035351b7 dt-bindings: interconnect: Add QCOM_ICC_TAG_PERF_MODE
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>
2022-05-02 09:07:16 -07:00
Mike Tipton
6d75baa3d2 interconnect: qcom: Add support for mask-based BCMs
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>
2022-05-02 09:07:16 -07:00
Mike Tipton
5d9a29660b interconnect: qcom: Set floor of 1 for BCM unit/width
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>
2022-05-02 09:07:16 -07:00
Vivek Aknurwar
07cbd50500 interconnect: qcom: Add stub icc_get_bw stub callback
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>
2022-05-02 09:07:16 -07:00
Mike Tipton
98b202c507 interconnect: qcom: Add debug library
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>
2022-05-02 09:07:06 -07:00
qctecmdr
907c83ab56 Merge "android: abi_gki_aarch64_qcom: Add USB driver symbols to ABI" 2022-04-29 20:41:38 -07:00
Mike Tipton
428497d097 interconnect: qcom: Add stub icc_set/aggregate() callbacks
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>
2022-04-29 17:21:17 -07:00
Mike Tipton
fc89958b2d interconnect: qcom: Ignore -EBUSY for AMC requests
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>
2022-04-29 17:21:17 -07:00
David Dai
1f6f4c0a2a interconnect: qcom: Add multiple voter support
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>
2022-04-29 17:21:17 -07:00
David Dai
a4165efa30 interconnect: qcom: Add QoS config support
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>
2022-04-29 17:21:14 -07:00
David Dai
0a20a2a4e7 interconnect: qcom: Add sync_state for QNOC
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>
2022-04-29 17:17:50 -07:00
David Dai
9787cfc9b5 iinterconnect: qcom: Hold high bandwidth vote for keepalive BCMs
Add a high bandwidth vote for critical NoCs during boot up.

Change-Id: I739df67083e13f542c0021054b1ca4c1f2d9bd09
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2022-04-29 17:17:50 -07:00
qctecmdr
aec4ceae3c Merge "modules.list.msm.pineapple: Add gcc clock module" 2022-04-29 12:52:56 -07:00
Wesley Cheng
407422ffae android: abi_gki_aarch64_qcom: Add USB driver symbols to ABI
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>
2022-04-29 11:18:43 -07:00
qctecmdr
ce693c08de Merge "build.config.msm.gki: Add sanity_check_abi()" 2022-04-28 21:00:17 -07:00
Chris Goldsworthy
3a684e8037 dma-heap: qcom: Take a snapshot of our DMA-BUF heap driver from msm-5.15
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>
2022-04-28 20:37:05 -07:00
Chris Goldsworthy
e117a3efa4 mem-buf: Take a snapshot of mem-buf-exporter.h from msm-5.15
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>
2022-04-28 20:36:58 -07:00
Guru Das Srinagesh
104be1a452 build.config.msm.gki: Add sanity_check_abi()
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>
2022-04-28 20:07:40 -07:00
qctecmdr
94d5b2aa9c Merge "abi_gki_aarch64_qcom: Add necessary symbols for SCM driver" 2022-04-28 18:37:11 -07:00
qctecmdr
82665d760a Merge "pineapple: Add USB modules to modules.list.msm.pineapple" 2022-04-28 16:21:11 -07:00
Guru Das Srinagesh
1c675f15c0 soc: altmode: Add correct notify message length check
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>
2022-04-28 13:31:24 -07:00
Guru Das Srinagesh
12f5185963 soc: qcom: altmode-glink: Execute client callback in work
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>
2022-04-28 13:31:04 -07:00
Guru Das Srinagesh
011cf3718b soc: altmode: Detect when remote subsys fails to respond
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>
2022-04-28 13:30:19 -07:00
Guru Das Srinagesh
5063ec589d soc: altmode: Add debugfs nodes to send PAN EN and PAN ACK
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>
2022-04-28 13:29:47 -07:00
Guru Das Srinagesh
51467ac1d6 soc: altmode: Remove altmode device name
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>
2022-04-28 13:29:00 -07:00
Guru Das Srinagesh
88a5ed5970 soc: altmode: Update client APIs, notifier bookkeeping
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>
2022-04-28 13:28:16 -07:00
Subbaraman Narayanamurthy
44c3a6cfe8 soc: qcom: altmode-glink: add SSR support
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>
2022-04-28 13:27:34 -07:00
Guru Das Srinagesh
46cbba2946 soc: qcom: Add Type-C alternate mode driver
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>
2022-04-28 13:26:26 -07:00
Subbaraman Narayanamurthy
ad98e248e2 soc: qcom: qti_battery_debug: add support for 2S battery context dump
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>
2022-04-28 13:23:01 -07:00
Guru Das Srinagesh
d9197e1de2 soc: qti_battery_debug: Move qbg_context to device bin file
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>
2022-04-28 13:22:18 -07:00
Guru Das Srinagesh
e4ea2b8741 soc: qcom: qti_battery_debug: Add NULL check
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>
2022-04-28 13:20:09 -07:00
Guru Das Srinagesh
cd857f2b69 soc: qti_battery_debug: Remove CONFIG_DEBUG_FS dependency
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>
2022-04-28 13:18:57 -07:00
Guru Das Srinagesh
1069d0fec8 soc: qti_battery_debug: Add votables R/W support
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>
2022-04-28 13:17:08 -07:00